
var childWindow;
$(function () {
    // 等于1表示可以执行动画
    $(".channel a").each(function(){
        $(this).hoverDelay({
            hoverDuring: 150,
            outDuring: 0,
            hoverEvent: function(){
                hoverAnimation( $(this),$(this).data("type") );
            },
            outEvent: function(){
                outAnimation( $(this),$(this).data("type") );
            }
        });
    });
    /**
     * hoverEvent执行的动画函数
     *
     */
    function hoverAnimation (obj,type) {
        obj.css('z-index',999);
        obj.find("span.default").animate({
            opacity: 0
        }, 500, function() {
            });
        obj.find("span.hover").animate({
            opacity: 0.4,
            top: 0
        }, 500, function() {
            obj.find("span.hover").animate({
                opacity: 1
            }, 150);
        });
        if (type==1) {
            obj.animate({
                width: 240
            },500);
        }
    }
    /**
     * outEvent执行的动画函数
     */
    function outAnimation (obj,type) {
        obj.find("span.default").animate({
            opacity: 1
        }, 280, function() {
            });
        obj.find("span.hover").animate({
            opacity: 1,
            top: 114
        }, 280, function() {
            obj.css('z-index',20);
        });
        if (type==1) {
            obj.animate({
                width: 114
            },280);
        }

    }
});

/**
*qq登录使用 
 */
function qqlogin(){
    childWindow = window.open("index.php?c=oauth&a=qq_login","TencentLogin","width=450,height=320,menubar=0,scrollbars=1, resizable=1,status=1,titlebar=0,toolbar=0,location=1");
} 
            
function closeChildWindow()
{
    childWindow.close();
}